import request from '@/utils/request'


export default {
    /**
     * 条件查询用户
     * @param queryParams 查询参数
     * 查询参数包含 role status type keyWord 用户名 姓名模糊搜索
     * pageSize pageCount 分页参数
     * 结果返回pageBean
     */
    findUserByParams(queryParams){
        return request({
            url:'/hnister-security-service/rest/pt/users/@/for=page&condition',
            params:{
                ...queryParams,
            },
            method:'get'
        })
    },
    /**
     * 添加用户，并配置role
     * @param user
     */
    insert(user) {
        return request({
            url:'/hnister-security-service/rest/pt/user',
            data:{
                ...user
            },
            method:'post'
        })
    },
    removeByUsername(username){
        return request({
            url:'/hnister-security-service/rest/pt/user/'+username,
            method:'delete'
        })
    },
    findByUsername(username){
        return request({
            url:'/hnister-security-service/rest/pt/user/'+username+'/@/for=admin',
            method:'get'
        })
    },
    edit:function (user) {
        return request({
            url:'/hnister-security-service/rest/pt/user/@/for=admin',
            method:'put',
            data:user
        })
    }
}
